package client.messageContent;

import common.CurrencyEnum;
import common.SerializationManager;
import common.data.TransferFundArgs;
import common.interfaces.MessageContent;

public class TransferFundMsgContent extends TransferFundArgs implements MessageContent {
	private byte[] data;
	
	public TransferFundMsgContent(long senderAccId, String senderName, String senderPassword, 
			long recipientAccId, String recipientName, float amount, CurrencyEnum currency){
		this.senderAccId = senderAccId;
		this.senderName = senderName;
		this.senderPassword = senderPassword;
		this.recipientAccId = recipientAccId;
		this.recipientName = recipientName;
		this.amount = amount;
		this.currency = currency;		
	}
	
	@Override
	public byte[] getByte(){
		try {
			data = SerializationManager.getCurrent().fromObject(this);
		} catch (IllegalArgumentException | IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;		
	}
	
	@Override
	public int getLength() {
		return this.data.length;
	}

}
